package com.poxz.mybatisplus.model.dto;

import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 订单DTO
 *
 * @author poxz
 */
@Data
public class OrderDTO {

    /**
     * 订单编号
     */
    @NotBlank(message = "订单编号不能为空")
    private String orderNo;

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空")
    @Min(value = 1, message = "用户ID必须大于0")
    private Long userId;

    /**
     * 商品名称
     */
    @NotBlank(message = "商品名称不能为空")
    private String productName;

    /**
     * 商品数量
     */
    @NotNull(message = "商品数量不能为空")
    @Min(value = 1, message = "商品数量必须至少为1")
    private Integer productCount;

    /**
     * 单价
     */
    @NotNull(message = "单价不能为空")
    @DecimalMin(value = "0.00", inclusive = false, message = "单价必须大于0")
    private BigDecimal unitPrice;

    /**
     * 订单总金额
     */
    @NotNull(message = "订单总金额不能为空")
    @DecimalMin(value = "0.00", inclusive = false, message = "订单总金额必须大于0")
    private BigDecimal totalAmount;

    /**
     * 优惠金额
     */
    private BigDecimal discountAmount;

    /**
     * 实付金额
     */
    @NotNull(message = "实付金额不能为空")
    @DecimalMin(value = "0.00", message = "实付金额不能为负")
    private BigDecimal actualAmount;

    /**
     * 订单状态(1:待支付 2:已支付 3:已发货 4:已完成 5:已取消 6:已退款)
     */
    private Integer status;

    /**
     * 支付方式(1:支付宝 2:微信 3:银行卡)
     */
    private Integer paymentMethod;

    /**
     * 订单备注
     */
    private String remark;
}
